package com.park.service.impl;

import com.park.domain.User;
import com.park.repository.DatabaseUserRepository;
import com.park.service.UserService;

import java.util.Collection;


/**
 * @author Aaron
 * @date 2021/3/2 10:53
 */
public class UserServiceImpl implements UserService {
    private DatabaseUserRepository databaseUserRepository;

    public UserServiceImpl(DatabaseUserRepository databaseUserRepository) {
        this.databaseUserRepository = databaseUserRepository;
    }

    @Override
    public Collection<User> getAll() {
        return databaseUserRepository.getAll();
    }

    @Override
    public Boolean register(User user) {
        return databaseUserRepository.save(user);
    }
}